package com.czxy.dem01;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

public class Test20 {

    public static void main(String[] args) throws IOException {

        String s = FileUtils.readFileToString(new File("data.txt"));

        Set<String> set = new HashSet<>();
        set.add(s);
        for (String s1 : set) {
            FileUtils.writeStringToFile(new File("result.txt"),s);
        }
    }
}
